import httpInstance from '@/utils/http.js'

/**
 * 获取产品分类
 * @param {*} id 根据 id 进行分类
 * @returns 
 */
export function getTopCategoryAPI(id) {
  return httpInstance({
    url: '/category',
    params: {
      id
    }
  })
}

/**
 * 获取二级分类列表数据
 * @param {*} id 分类id
 * @returns 
 */
export const getCategoryFilterAPI = (id) =>{
  return httpInstance({
    url:'/category/sub/filter',
    params:{
      id
    }
  })
}

/**
 * 获取导航数据
 * @param {*} data 
 * @returns 
 */
export const getSubCategoryAPI = (data) =>{
  return httpInstance({
    url:'/category/goods/temporary',
    method:'POST',
    data
  })
}
